﻿#ifndef UPLOADFILE_H
#define UPLOADFILE_H

#include <QObject>
#include <dbHelper.h>
#include <QTableWidgetItem>
#include <QCheckBox>
#include "xlsxdocument.h"
#include <QFileDialog>
#include <dbHelper.h>
#include <QHBoxLayout>
#include <QDebug>
#include <QStyleFactory>
#include <QDesktopWidget>
#include <QListWidgetItem>
#include <QItemDelegate>
#include <QFontDatabase>
#include <QQmlContext>
#include <QQmlApplicationEngine>
#include <QMessageBox>

class UploadFile : public QObject
{
    Q_OBJECT

public:
    UploadFile();

    ~UploadFile();

    Q_INVOKABLE QStringList kzyqname();// 前端仪器读
    Q_INVOKABLE void fileTypeChange(QString type);// 前端仪器写
    Q_INVOKABLE QString fileChoose();// 选择文件
    Q_INVOKABLE QStringList jyfxyname();// 前端仪器读
    Q_INVOKABLE void isched(int index,QString flag);// 行是否选中
    Q_INVOKABLE void isname(int index, QString name);// 名字选中
    Q_INVOKABLE void isvolume(int index, QString volume);// 体系选中
    Q_INVOKABLE QVariantList allnames();// 名字查询
    Q_INVOKABLE QVariantList allvolumes();// 体系查询
    Q_INVOKABLE int jy();// OK校验
    Q_INVOKABLE void datain();// 数据导入
    Q_INVOKABLE QVariantList tran();//AL AS Y
    Q_INVOKABLE void datao();//导出

    bool filefl;
    QList<QString> ische= {"0","0","0"};
    QList<QString> types= {"常STR","Y-STR","Mini-STR"};
    QList<QString> names={"Verifiler Plus","Y41白金","新海NHID Mini 25A "};
    QList<QString> volumes={"10","10","10"};
    QString Y;
    QString AS;
    QString AL;
    QStringList bzend,fbzend,vaend;
    QList<int> bzed,fbzed;

    QVector<QStringList> table1Data; // 表格数据
    QVector<QStringList> table2Data; // 表格数据
    bool miniSTRfl=false;
    bool YSTRfl=false;

    int tabifl=1;
    void table();
    void datacu(int row, double famn, double vicn, double roxn, double cqv, double cqbz);
    void dataca(int row, double ICS, double DI, double AL, double AS, double Y);
    void xsui(int row, QString type, int tx);
    Q_INVOKABLE QList<int> typeNum();
    QVector<QStringList> tab2Fil(QString type);
    Q_INVOKABLE QVariantList getGuideTable1();
    Q_INVOKABLE QVariantList getGuideTable2(QString type);

};

#endif // UPLOADFILE_H
